package time;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.table.DefaultTableModel;

/**
* Simple demo that uses java.util.Timer to schedule a task to execute
* once 5 seconds have passed.
*/

public class Reminder {
	  Timer timer;
     public void begin(){
    	 timer = new Timer();
         timer.schedule(new RemindTask(), 4*1000);
     }

    class RemindTask extends TimerTask {
        public void run() {
            System.out.println("开始了");// do something
           timer.cancel(); 
        }
    }

    public static void main(String args[]) {
    	Reminder r= new Reminder();
    	r.begin();
    }
}